/*
 ============================================================================
 Name		: CelestialSphereAppUi.h
 Author	  : Den Grigorenko
 Copyright   : Copyright (c) 2008 Den123
 Description : Declares UI class for application.
 ============================================================================
 */

#ifndef __CELESTIALSPHEREAPPUI_h__
#define __CELESTIALSPHEREAPPUI_h__

// INCLUDES
#include <aknappui.h>

#include "PosReader.h"
#include "SimpleTimer.h"

// FORWARD DECLARATIONS
class CCelestialSphereAppView;

// CLASS DECLARATION
/**
 * CCelestialSphereAppUi application UI class.
 * Interacts with the user through the UI and request message processing
 * from the handler class
 */
class CCelestialSphereAppUi : public CAknAppUi,
							  public MPositionReaderObserver,
	                          public MSimpleTimerNotify							  
{
public:
	// Constructors and destructor

	/**
	 * ConstructL.
	 * 2nd phase constructor.
	 */
	void ConstructL();

	/**
	 * CCelestialSphereAppUi.
	 * C++ default constructor. This needs to be public due to
	 * the way the framework constructs the AppUi
	 */
	CCelestialSphereAppUi();

	/**
	 * ~CCelestialSphereAppUi.
	 * Virtual Destructor.
	 */
	virtual ~CCelestialSphereAppUi();

public: // from MPositionReaderObserver
    void ReadingComplete( TPositionInfoBase& aPosInfo );
    void ReadingError( TInt aErrorNo );

public: // MSimpleTimerNotify
	void TimerExpired( TAny* aTimer,TInt aError );

    
private:
	// Functions from base classes

	/**
	 * From CEikAppUi, HandleCommandL.
	 * Takes care of command handling.
	 * @param aCommand Command to be handled.
	 */
	void HandleCommandL(TInt aCommand);

	/**
	 *  HandleStatusPaneSizeChange.
	 *  Called by the framework when the application status pane
	 *  size is changed.
	 */
	void HandleStatusPaneSizeChange();

	void HandleResourceChangeL(TInt aType);
	
	void HandleForegroundEventL( TBool  aForeground ); 	

private:
	// Data

	/**
	 * The application view
	 * Owned by CCelestialSphereAppUi
	 */
	CCelestialSphereAppView* iAppView;
	
private:
	TBool iInBackground;
	CPositionReader* iReader;	
	CSimpleTimer* iTimer;	
};

#endif // __CELESTIALSPHEREAPPUI_h__
// End of File
